package com.zyong.design.pattern.observer.case3;

import java.util.Observable;

/**
 * @program: zyong-design-pattern
 * @ClassName: Thief
 * @author: zyong
 * @create: 2024-05-15 00:17
 */
public class Thief extends Observable {
    private String name;

    public Thief(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void steal() {
        System.out.println(name + ":我偷东西了,有没有人来抓我！！！");

        super.setChanged();
        super.notifyObservers();
    }
}
